#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int INF = 0x3f3f3f3f;
typedef pair<int, int> pi;
pi dp[N / 2][2];
char s[N];
int c[N / 2];
pi operator+(const pi &a, const pi &b) {
  return {a.first + b.first, a.second + b.second};
}
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    cin >> s + 1;
    for (int i = 1; i <= n; ++i) s[i] -= '0';
    // 字符转整数方便处理
    for (int i = 1; i <= n / 2; ++i) c[i] = s[i * 2] + s[i * 2 - 1] * 2;
    for (int i = 1; i <= n / 2; ++i)
      for (int j = 0; j < 2; ++j) dp[i][j] = {INF, INF};
    for (int i = 1; i <= n / 2; ++i) {
      for (int j = 0; j < 2; ++j) {
        int cc = c[i],       // 当前二元组
            dd = j ? 3 : 0;  // 目标二元组
        int cnt = ((dd % 2) ^ (cc % 2)) + ((dd / 2) ^ (cc / 2));
        for (int k = 0; k < 2; ++k) {
          dp[i][j] = min(dp[i][j], dp[i - 1][k] + pi{cnt, j != k});
        }
      }
    }
    pi ans = min(dp[n / 2][0], dp[n / 2][1]);
    cout << ans.first << ' ' << ans.second + 1 << '\n';
  }
}
